<template>
	<view class="page-body">
		<el-form :inline="true" class="demo-form-inline">
		  <el-form-item label="状态">
		    <el-select v-model="value" filterable placeholder="请选择">
		        <el-option
		          v-for="item in options"
		          :key="item._id"
		          :label="item.name"
		          :value="item._id">
		        </el-option>
		      </el-select>
		  </el-form-item>
      <el-form-item>
        <el-input v-model="name" placeholder="请输入名称"></el-input>
      </el-form-item>
		  <el-form-item>
		    <el-button type="primary" @click="onSubmit">查询</el-button>
		  </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="add">添加组织</el-button>
      </el-form-item>
		</el-form>
    <el-table
        :data="tableData"
        style="width: 100%"
        max-height="500">
        <el-table-column
          fixed
          prop="name"
          label="组织名称"
          width="200">
        </el-table-column>
        <el-table-column
          fixed
          prop="a"
          label="添加时间"
          width="200">
        </el-table-column>
        <el-table-column
          prop="subway_str"
          label="组织状态"
          >
        </el-table-column>
        <el-table-column
          prop="address_map"
          label="组织成员"
          width="240">
        </el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
          width="180">
          <template slot-scope="scope">
            <el-button
              @click.native.prevent="auditRow(scope.$index, tableData)"
              type="text"
              size="small">
              添加成员
            </el-button>
            <el-button
            v-if="tableData[scope.$index].status==2"
              @click.native.prevent="auditRow(scope.$index, tableData)"
              type="text"
              size="small">
              启用
            </el-button>
            <el-button
            v-if="tableData[scope.$index].status==3"
              @click.native.prevent="onRow(scope.$index, tableData)"
              type="text"
              size="small">
              禁用
            </el-button>
          </template>
        </el-table-column>
      </el-table>

		<!-- 添加组织 -->
    <el-dialog
      title="提示"
      :visible.sync="add1"
      width="30%"
      :before-close="handleClose">
      <span>这是一段信息</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="add1 = false">取 消</el-button>
        <el-button type="primary" @click="add1 = false">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 添加成员 -->
    <el-dialog
      title="提示"
      :visible.sync="add2"
      width="30%"
      :before-close="handleClose">
      <span>这是一段信息</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="add2 = false">取 消</el-button>
        <el-button type="primary" @click="add2 = false">确 定</el-button>
      </span>
    </el-dialog>
	</view>
</template>

<script>
  export default {
    data() {
      return {
        options: [
          {
            id: 1,
            name:'启用'
          },
          {
            id: 2,
            name: '停用'
          }
        ],
        add1: false,
        add2: false,
        tableData: []
      }
    },
    methods: {
      
    }
  }
</script>

<style>

</style>
